

<template>
  <h1 class="title animate__animated animate__lightSpeedInLeft">社团简介</h1>
  <div class="line animate__animated animate__lightSpeedInRight">
    <p class="breadcrumb">您所在的位置：首页>了解社团>{{locationText}}</p>
  </div>
  <div class="animate__animated animate__lightSpeedInLeft tab-container">
    <el-row :gutter="12" class="tab-row">
      <el-col :span="24" :md="8">
        <div class="page_head_leaf" @click="introduce">社团简介</div>
      </el-col>
      <el-col :span="24" :md="8">
        <div class="page_head_leaf" @click="showCulture">社团文化</div>
      </el-col>
      <el-col :span="24" :md="8">
        <div class="page_head_leaf" @click="showContact">联系我们</div>
      </el-col>
    </el-row>
  </div>
  <div class="animate__animated animate__lightSpeedInRight">
    <h2 v-if="activeTab === 'company'">社团简介</h2>
    <h2 v-else-if="activeTab === 'culture'">社团文化</h2>
    <h2 v-else-if="activeTab === 'contact'">联系我们</h2>
  </div>
  <div class="content-container">
    <transition name="fade" mode="out-in">
      <div class="animate__animated animate__zoomIn" v-if="activeTab === 'company'">
        <p class="company-intro">{{ company }}</p>
      </div>
      <div class="animate__animated animate__zoomIn" v-else-if="activeTab === 'culture'">
        <div class="culture-container">
          <div class="culture-item" v-for="(item, index) in culture.title" :key="index">
            <h3 class="culture-title">{{ item }}</h3>
            <p class="culture-content">{{ culture.content[index] }}</p>
          </div>
        </div>
      </div>
      <div class="animate__animated animate__zoomIn contact-container" v-else-if="activeTab === 'contact'">
        <p class="contact-info">{{ contact.site }}</p>
        <p class="contact-info">{{ contact.contact }}</p>
        <p class="contact-info">{{ contact.email }}</p>
      </div>
    </transition>
  </div>
</template>

<script>
import "animate.css";
import { Edit } from '@element-plus/icons-vue';
export default {
  components: {
    Edit
  },
  data() {
    return {
      activeTab: "company",
      locationText: "社团简介",
      company:
        "科学技术创新协会秉承"+"创新引领未来，科技服务社会"+"的理念，" +
        "以赛促学、以赛促创"+"为核心路径，通过参与竞赛、项目孵化和学科交叉实践，" +
        "全面提升成员在考研、就业、产品研发及商业转化等领域的核心能力，" +
        "致力于打造具有学术深度、实践温度和社会责任感的科技创新共同体。"+
        "科学技术创新协会以协会社长为总指挥的领导方针，包含竞赛，竞赛服务，财务管理，社团规划，社团部门分配等问题以及后续的不断完善方针。",
      culture: {
        title: ["创新无畏", "团体至上", "协作共生", "责任担当"],
        content: [
          "鼓励突破性思维，容忍试错，追求技术前瞻性。",
          "以需求为导向，用科技解决真实痛点。",
          "打破部门壁垒，倡导跨部门协同创新。",
          "坚持科技向善，推动技术普惠与社会可持续发展。",
        ],
      },
      contact: {
        site: "地址：重庆市对外经贸学院",
        contact: "联系方式：023-12312312",
        email: "邮箱：652985849@qq.com",
      },
    };
  },
  methods: {
    introduce() {
      this.activeTab = "company";
      this.locationText = "社团简介";
    },
    showCulture() {
      this.activeTab = "culture";
      this.locationText = "社团文化";
    },
    showContact() {
      this.activeTab = "contact";
      this.locationText = "联系我们";
    },
  },
};
</script>

<style scoped>
.title {
  font-size: 2.5rem;
  text-align: left;
  margin-left: 5%;
  margin-right: 5%;
}

.line {
  height: 50px;
  background: linear-gradient(to right, white, 60%, rgb(217, 215, 215));
  display: flex;
  align-items: center;
}

.breadcrumb {
  text-align: left;
  margin-left: 5%;
  margin-right: 5%;
  font-size: 0.9rem;
}

.tab-container {
  display: flex;
  justify-content: center;
  padding: 0 5%;
}

.tab-row {
  width: 100%;
  max-width: 1200px;
}

.page_head_leaf {
  padding: 15px 10px;
  border-radius: 6px;
  display: block;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  margin-bottom: 10px;
  font-size: 1rem;
}

.page_head_leaf:hover {
  background-color: red;
  color: white;
}

.content-container {
  padding: 0 5%;
  margin: 20px 0;
}

.company-intro {
  font-size: 1rem;
  line-height: 1.6;
  text-align: justify;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

.culture-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.culture-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  text-align: left;
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
}

.culture-title {
  color: red;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.culture-content {
  font-size: 1rem;
  line-height: 1.5;
}

.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-info {
  font-size: 1rem;
  margin-bottom: 10px;
}

/* 平板设备 */
@media (min-width: 768px) {
  .title {
    font-size: 3.5rem;
    margin-left: 60px;
  }
  
  .breadcrumb {
    margin-left: 60px;
    font-size: 1rem;
  }
  
  .page_head_leaf {
    padding: 22px 30px;
    display: inline-block;
    margin-bottom: 0;
    font-size: 1rem;
  }
  
  .culture-item {
    flex-direction: row;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0;
  }
  
  .culture-title {
    font-size: 1.5rem;
    margin-bottom: 0;
    min-width: 120px;
  }
  
  .culture-content {
    font-size: 1rem;
  }
  
  .company-intro {
    font-size: 1.1rem;
  }
  
  .contact-info {
    font-size: 1.1rem;
  }
}

/* 桌面设备 */
@media (min-width: 1024px) {
  .title {
    font-size: 4rem;
    margin-left: 60px;
  }
  
  .page_head_leaf {
    padding: 22px 30px;
  }
  
  .company-intro {
    font-size: 1.2rem;
  }
  
  .culture-title {
    font-size: 1.7rem;
    min-width: 150px;
  }
}

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s;
}
.fade-enter-from, .fade-leave-to {
  opacity: 0;
}
</style>